<?php

class m120601_105415_update_employee extends EDbMigration {

	public function safeUp() {
		$this->addColumn('employees', 'isManagement', 'boolean');
		
		$columns = array('isManagement'=>0);
		$this->update('employees', $columns);
		
		$columns = array('gender'=>GenderListBehavior::FEMALE);
		$conditions = 'gender = :gender';
		$params = array(':gender'=>'F');
		$this->update('employees', $columns, $conditions, $params);
		
		$columns = array('gender'=>GenderListBehavior::MALE);
		$conditions = 'gender = :gender';
		$params = array(':gender'=>'M');
		$this->update('employees', $columns, $conditions, $params);
	}

	public function safeDown() {
		$this->dropColumn('employees', 'isManagement');
	}

}